home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
amos
/
fundraw.lha
/
fundraw.amos
/
fundraw.amosSourceCode
Wrap
AMOS Source Code
|
1999-05-02
|
2KB
|
94 lines
' FunDraw version 1.0
'
' left mouse to draw steps
' right mouse to play sequence!
' (c)�99 D.Lenz (Vertex Entertainment)
' http://www.vertex-entertainment.de.cx
' email: vertex@topmail.de
'
Set Buffer 512
Erase All
Screen Open 0,320,256,32,Lowres : Palette $0,$FFF
Curs Off : Flash Off : Ink 1 : Cls 0 : Pen 1 : Paper 0
Dim XP(2048),YP(2048)
Global XP(),YP(),B,C,ST
Change Mouse 2
Do
Cls 0 : C=0
Locate 0,0
Print "recording... (max. steps 2048)"
Print "step:";C
Repeat
If Mouse Key=1
XM=X Screen(X Mouse) : YM=Y Screen(Y Mouse)
Plot XM,YM,1 : XP(C)=XM : YP(C)=YM
Inc C : Wait Vbl : Print At(5,1);C
End If
Until Mouse Key=2 or C>2048
Cls 0
Locate 0,0 : Print "playing..." : Print "step:";B
Hide
For B=0 To C
Print At(5,1);B
Ink Rnd(31)+1 : Circle XP(B),YP(B),Rnd(2)+1 : Wait Vbl
Next
Locate 0,25
Print "(S)ave Sequence"
Print "(L)oad Sequence"
Print "(N)ew Sequence"
Repeat : K$=Inkey$ : Until K$<>""
Show
If K$="s" Then _SAVE_SEQ
If K$="l" Then _LOAD_SEQ
If K$="n" Then _NEW_SEQ
Procedure _SAVE_SEQ
F$=Fsel$("work:*.fds","","give your new","sequence a name")
If F$=""
Pop Proc
Else
Open Out 1,F$
Print #1,B
For C=0 To B
Print #1,XP(C)
Print #1,YP(C)
Next
Close 1
End If
End Proc
Procedure _LOAD_SEQ
F$=Fsel$("work:*.fds","","choose a fundraw-","sequence to load")
If F$=""
Pop Proc
Else
Cls 0
Locate 0,0
Print "Loading Sequence..."
Open In 1,F$
On Error Goto _RHAN
Input #1,B
Print "Counting Steps..."
If B=0
_RHAN:
Print "Error loading sequence" : Wait Key : Resume : Pop Proc
End If
Print "Reading Steps..."
For C=0 To B
On Error Goto _RHAN
Input #1,XP(C)
Input #1,YP(C)
Next
Close
Print "Done."
Wait 15
Cls 0
Locate 0,0 : Print "playing..." : Print "step:";B
For C=0 To B
Print At(5,1);C
Ink Rnd(31)+1 : Circle XP(C),YP(C),Rnd(2)+1 : Wait Vbl
Next
End If
End Proc
Procedure _NEW_SEQ
Bell : Wait 1 : Sam Stop
End Proc
Loop